/**
 * Show a mask to block input and display "please wait..." message.
 */
if ((typeof Atsm) == 'undefined' && (typeof jQuery) != 'undefined') {
	var Atsm = {};
	Atsm.Mask = {
		init : function() {
			var scope;

			// to keep the scope 'this' alive
			scope = this;
			jQuery(document).keypress(function(e) {
				// check if user hit ESC key.
				if (e.keyCode == 27) {
					scope.hide();
					scope.hideGlass();
				}
			});
		},
		show : function() {
			jQuery.blockUI({
				message : '<img src="ajax-loader.gif"/> Chỉ một lát thôi...',
				css : {
					padding : '5px',
					backgroundColor : '#000000',
					opacity : .5,
					color : '#ffffff'
				}
			});
		},
		hide : function() {
			jQuery.unblockUI();
		},
		showGlass : function() {
			jQuery.blockUI({
				message : null,
				overlayCSS : {
					backgroundColor : '#000000',
					filter : 'alpha(opacity=0)',
					opacity : 0.0
				}
			});
		},
		hideGlass : function() {
			jQuery.unblockUI();
		}
	};
}